/**
 * 能力综合评分
 */
import { Icon, Tag, Tooltip } from 'antd';
import React from 'react';
import { FormContent } from '../../components';
import AssessTag from './AssessTag';

export default function AssessTotal({ data = {}, style, levels }) {
    const { score, level, teacherEqLeader } = data;
    const onlyLeader = teacherEqLeader === 1;

    return (
        <FormContent style={style}>
            <div style={{ display: 'flex', alignItems: 'center' }}>
                <span>能力综合分</span>
                {onlyLeader && (
                    <Tooltip title="能力综合分 = 带教人评分 * 40% + 部门主管评分 * 60%">
                        <Icon type="info-circle" style={{ padding: 8 }} />
                    </Tooltip>
                )}
                <span>：</span>
                {score ? (
                    <>
                        <span style={{ padding: 8 }}>{score}</span>
                        <AssessTag title={level} levels={levels} />
                    </>
                ) : (
                    <Tag>待评估</Tag>
                )}
            </div>
        </FormContent>
    );
}
